package com.zhouyibike.uu.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.TextView;

import com.zhouyibike.uu.R;
import com.zhouyibike.uu.entity.Cityinfo;
import com.zhouyibike.uu.entity.Mycity2;
import com.zhouyibike.uu.entity.Threecity;
import com.zhouyibike.uu.ui.adapter.Cityt2Adapter;
import com.zhouyibike.uu.ui.adapter.Cityt3Adapter;
import com.zhouyibike.uu.ui.base.BaseActivity;

import java.util.ArrayList;
import java.util.List;

public class Cityt3Activity extends BaseActivity {
    private ListView citylv;
    private Cityt3Adapter adapter1;
    private List<Cityinfo> curCity;
    private TextView mBtnTitle;
    private Mycity2 Curcity;
    private ArrayList<Mycity2.CitiesBean>  listcity=new ArrayList<>();
    private Threecity mycity;
    private Cityt2Adapter cityt2Adapter;
    private ArrayList<String> zuihoulist=new ArrayList<>();
    private String shiname;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_cityt);
        /******/
        citylv= (ListView) findViewById(R.id.citylv);
//        curCity= (List<Cityinfo>) getIntent().getSerializableExtra("citylist");
        zuihoulist= (ArrayList<String>) getIntent().getSerializableExtra("citylist");
        adapter1=new Cityt3Adapter(this,zuihoulist);
        citylv.setAdapter(adapter1);
        mBtnTitle= (TextView) findViewById(R.id.bar_text_title);
        mBtnTitle.setText("县/区");
        citylv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                Intent i=new Intent();
                i.putExtra("cityname",zuihoulist.get(position));
                setResult(1,i);
                finish();
            }
        });
        /******/

    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
    }
}
